﻿@{
    ViewBag.Title = "ViewWishList";
   
}
<style>
    #container
    {
        background-color: white;
        min-height: 1300px !important;
    }
    .housewrap
    {
        position: relative;
        height: 140px;
        margin-bottom: 20px;
        margin-left: 10px;
        border-bottom: 1px solid #D8D8D8;
    }
    .housecontainer
    {
        margin-left: 25px;
        margin-right: 20px;
        float: left;
        top: 10px;
        position: relative;
        font-family: "Helvetica Neue" ,Helvetica,Arial,sans-serif;
        margin-top: 10px;
    }
    .housecontainer img
    {
        height: 100px;
        width: 140px;
        border: 1px solid #333;
    }
    .housecontainer img:hover
    {
        border: 1px solid rgba(237, 29, 137, 0.8);
        -webkit-box-shadow: 0 0 6px rgba(237, 29, 137, 0.8),0 0 0 black;
        -moz-box-shadow: 0 0 6px rgba(237,29,137,0.8),0 0 0 #000;
        box-shadow: 0 0 6px rgba(237, 29, 137, 0.8),0 0 0 black;
    }
    .caption
    {
        padding: 35px 10px 5px;
        background-color: transparent;
        border-width: 0;
        width: 260px;
        bottom: 4px;
        position: absolute;
        color: white;
    }
    
    #headbox
    {
        height: 40px;
        background-color: #c30;
        text-align: left;
        font-size: 1.5em;
        padding-left: 10px;
        color: white;
        position: relative;
    }
    #mywishlist
    {
        width: 100%;
        background-color: white;
        padding-bottom: 20px;
    }
    #information
    {
        float: left;
        margin-left: 10px;
        font-size: 1.0em;
        margin-top: 20px;
    }
    #information p:hover
    {
        color: seagreen;
    }
    #remove a
    {
        text-decoration: none;
        background: #4D97F1;
        display: inline-block;
        color: white;
        font-family: Helvetica, Arial, sans-serif;
        font-weight: 900;
        padding: 4px 4px;
        font-size: 15px;
        left: 125px;
        top: 97px;
        width: 75px;
        text-align: center;
    }
    #remove a:hover
    {
        background-color: #EF411A;
    }
    #remove2 a
    {
        text-decoration: none;
        background: #4D97F1;
        display: inline-block;
        color: white;
        font-family: Helvetica, Arial, sans-serif;
        font-weight: 900;
        padding: 4px 4px;
        font-size: 15px;
        left: 200px;
        top: 80px;
        width: 75px;
        text-align: center;
        position: absolute;
    }
    #remove2 a:hover
    {
        background-color: #EF411A;
    }
    #titlepost
    {
        color: #1D95CB;
        font-size: 1.5em;
    }
    #price
    {
        font-size: 1.5em;
        position: absolute;
        top: 40px;
        left: 1000px;
        text-decoration: none;
        font-weight: bold;
        color: royalblue;
    }
    #price:hover
    {
        color: violet;
    }
</style>
<div id="wishlist">
    <div id="headbox">
        <div style="font-size: 20px; position: absolute; top: 10px;">
            My Wishlist
        </div>
    </div>
    <div id="mywishlist">
        @{
            if (HttpContext.Current.Session["username"] != null && !HttpContext.Current.Session["username"].ToString().Equals(""))
            {
                if (ViewBag.WishList == null)
                {
            <h3>
                Your wishlist is empty</h3>
                }
                else
                {
                    foreach (var item in ViewBag.WishList)
                    {
           
            <div class="housewrap">
                @if (item.PostStatus > 0)
                {
                    <div class="housecontainer">
                        <a href="/Posts/ViewPost?postID=@item.PostID">
                            <img src="@item.ImageName"/>
                        </a>
                    </div>
                    <div id="information">
                        <div id="titlepost">
                            <a href="/Posts/ViewPost?postID=@item.PostID">@item.PostTitle</a>
                        </div>
                        <div id="address">
                            Address : @item.Address</div>
                        <div id="timeadd">
                            Time Added : @item.TimeAdded</div>
                        <div id="remove">
                            @Ajax.ActionLink("Remove", "DeleteWishListItem", "Wishlists", new { postID = @item.PostID }, new AjaxOptions() { UpdateTargetId = "wishlist" })
                        </div>
                    </div>
                    <div id="price">
                        @if (item.PricePerDay > 0)
                        {

                            @item.PricePerDay
                        }
                        else
                        {
                            if (item.PricePerWeek > 0)
                            {
                            @item.PricePerWeek
                            }
                            else
                            {
                            @item.PricePerMonth
                            }
                        }
                        $
                        @if (item.PricePerDay > 0)
                        {

                            <p>
                                perdate</p>
                        }
                        else
                        {
                            if (item.PricePerWeek > 0)
                            {
                            <p>
                                perweek</p>
                            }
                            else
                            {
                            <p>
                                permonth</p>
                            }
                        }
                    </div>
                }
                else if (item.PostStatus == 0)
                {
                    <div class="housecontainer">
                        <a href="#">
                            <img src="@item.ImageName"/>
                        </a>
                    </div>
                    <p style="position: absolute; top: 60px; left: 200px; font-weight: bold; font-size: 15px;
                        color: royalblue">
                        This content of post is changed by host and is waiting for review!Please comeback
                        later!Thank you
                    </p>
                    <div id="remove2">
                        @Ajax.ActionLink("Remove", "DeleteWishListItem", "Wishlists", new { postID = @item.PostID }, new AjaxOptions() { UpdateTargetId = "wishlist" })
                    </div>
                }
                else if (item.PostStatus < 0)
                {
                    <div class="housecontainer">
                        <a href="#">
                            <img src="@item.ImageName"/>
                        </a>
                    </div>
                    <p style="position: absolute; top: 60px; left: 200px; font-weight: bold; font-size: 15px;
                        color: red">
                        This Post has deleted!
                    </p>
                    <div id="remove2">
                        @Ajax.ActionLink("Remove", "DeleteWishListItem", "Wishlists", new { postID = @item.PostID }, new AjaxOptions() { UpdateTargetId = "wishlist" })
                    </div>
                }
            </div>
                    }

                }
            }
            else
            {
            <h3>
                You must login to view your wishlist or register an account.</h3>
            }
        
        }
    </div>
</div>
